#!/usr/bin/env python

import	socket

def	main(port=4344, loops=100) :
	s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
	s.settimeout(1.0)
	address = ('', port)
	for i in range(loops) :
		msg = '#%05d message' % (i + 1, )
		s.sendto( msg, 0, address )
		try :
			reply, peer_addr = s.recvfrom( 65536 )
			print 'reply:',reply
		except socket.timeout :
			pass

if	__name__ == '__main__' :
	main()
